-
Notifications
You must be signed in to change notification settings - Fork 2.1k
pkg/tinydtls: various bugfixes #21827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
currently, sock_dtls_get_event_session would return a previous session instead of none as documented fixes an assertion failure in tests/pkg/tinydtls_sock_async on a second request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just some nits on documentation and commit messages.
Also, could you maybe in the testing instructions explicitly provide some of the things you did to "play around with the tests" (beyond the reproducing instructions in the summary), so I can test it myself. Thanks!
This way unconsumed application data is not overwritten.
also document that other messages are currently silently ignored from the mbox
They are not needed as the sock_async_event (and potential other backends should) accumulate(s) the flags internally already, and they have been sent out on data arrival or connection establishment already.
5ea1ee3 to
59446cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review, I was so brave to directly squash on force-push (to be able to edit the commit messages as requested).
|
Currently no time for testing, so I leave that and the final ACK resulting from that to someone else :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that this still works with coap-client-openssl and tests/net/nanocoap_cli
Contribution description
While testing #21582, we found various issues in the current tinydtls
sock_dtlsimplementation.On master,
tests/pkg/tinydtls_sock_asyncwould throw an assertion failure on the second request from another instance of the same application (since the async session information is not reset). With the first commit, this does not happen anymore.On master,
examples/networking/coap/gcoap_dtlswould print (withDEBUGenabled)and not respond to any packages sent out by libcoap (with
coap-client-gnutls "coaps://[<IP>%tap0]/.well-known/core" -k "secretPSK" -u "Client_identity"(presumably because the application data message is returned instead of the handshake completion signal). With the third commit of this PR, it works as expected.The zero-copy
sock_dtls_recv_bufAPIs are currently untested by application code (gcoap uses copy-versions), but unicoap does use them. Applying #21582 (with some changes) on top of this PR shows that the fifth commit is needed for proper functioning.The sixth commit removes unnecessary (and broken) logic which would send flags more than once. Those are not needed as the
sock_async_event(and potential other backends should) accumulate(s) the flags internally already.Testing procedure
Play around with
tests/pkg/tinydtls_sock_asyncandexamples/networking/coap/gcoap_dtls, or any other (your favorite) application using dtls_sock over tinydtls.References
Some of the changes have already been discussed with @miri64 offline.